package com.zq.sysuser.controller;

import com.zq.common.util.Result;
import com.zq.minio.service.MinioService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author 张乔
 * @Date 2025/2/26 13:22
 */
@RestController
@RequestMapping("/sys/file")
@Slf4j
public class FileUploadController {


    @Autowired
    private MinioService minioService;

    //    文件上传
    @PostMapping(value = "/fileUpload")
    public Result<String> fileUpload(MultipartFile file){
        String url=  minioService.uploadFile(file);
        log.error("文件上传成功"+url);
        return Result.successData(url);
    }

}
